package com.trjn.util;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ReUtil;
import cn.hutool.core.util.ZipUtil;
import cn.hutool.http.HttpUtil;

import java.nio.charset.Charset;

/**
 * @author : XieDong
 * @date : 2019/1/9 00:23
 */
public class TestReg {

    public static void main(String[] args) throws Exception{
        String header = "Content-Length: 485";
        String contentLength = ReUtil.get("Content-Length: ([1-9]\\d*)", header, 1);
        System.out.println(contentLength);

        byte[] bytes = ZipUtil.unGzip(FileUtil.getInputStream("a.gzip"));
        String string = HttpUtil.getString(bytes, Charset.forName("utf-8"), true);
        System.out.println(string);

    }
}
